import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
df =pd.read_excel('服装销售数据.xlsx')
height_data = []
height_data.append(df['针织衫'])
height_data.append(df['卫衣'])
height_data.append(df['连衣裙'])
x_data = np.arange(len(df['门店']))
plt.figure (figsize=(8,5))
plt.rcParams['font.sans-serif']= 'SimHei'
plt.title('各门店不同类服装销售额簇状柱形图')
plt.ylabel('销售额(元)')
width = 0.25
for i in range(len(height_data)):
     x = x_data + i * width
     height = height_data[i]
     plt.bar (x, height, width)
     for a, b in zip(x, height):
         plt.text(a, b, '%d' % b, ha='center')
plt.xticks(x_data+width,df['门店'])
plt.legend(('针织裙','卫衣','连衣裙'))
plt.show()